#ifndef PROBER_H
#define PROBER_H

#include <QObject>
#include <QTcpServer>
#include <QHostAddress>
#include <QTcpSocket>
#include "datastruct.h"

class Prober : public QObject
{
    Q_OBJECT
public:
    explicit Prober(QObject *parent = 0);
    ~Prober();
private:
    QTcpServer              *tcpserver;
    QList<QTcpSocket* >     linkList;
    int                     serverPort;
private slots:
    void updateserver();

    void closeListen();
    bool openListen();

    void updateSendStatus();
    void readServerMessage();
    void updateListInfo();
public slots:
    void startListen();
signals:
    void sendLinkStatus(const QString &message);
    void sendProberList(const ProberListStruct &probers);
};

#endif // PROBER_H
